/**
 * 定义一个类，并在原型上添加方法
 * 
 * 知识点
 *      1、method 1 与 method 2 不能混用
 */
var CheckObject = function() {};

// method 1
CheckObject.prototype.checkName = function() {
    console.log('CheckObject');
};

CheckObject.prototype.checkEmail = function() {
    console.log('checkEmail');
};

CheckObject.prototype.checkPsw = function() {
    console.log('checkPsw');
};

// method 2
/*CheckObject.prototype = {
    checkName: function() {
        console.log('CheckObject');        
    },
    checkEmail: function() {
        console.log('checkEmail');        
    },
    checkPsw: function() {
        console.log('checkPsw');        
    }
};*/

var a = new CheckObject();
a.checkName();
a.checkEmail();
a.checkPsw();
